package com.conn;

import com.conn.*;

import java.io.*;

import javax.xml.parsers.*;
import org.w3c.dom.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
import org.xml.sax.*;

public class Packer1 extends Packer {
    public String registerPack(RegisterInfo ri) {
        Document doc = XmlHelper1.genDocWithHeader(Command.REGISTER);
        XmlHelper1.addElement(doc, "username", ri.username);
        XmlHelper1.addElement(doc, "passwd", ri.passwd);
        XmlHelper1.addElement(doc, "email", ri.email);
        XmlHelper1.addElement(doc, "name", ri.name);
        XmlHelper1.addElement(doc, "sex", ri.sex);
        XmlHelper1.addElement(doc, "birthday", ri.birthday);
        XmlHelper1.addElement(doc, "phone", ri.phone);
        XmlHelper1.addElement(doc, "country", ri.country);
        XmlHelper1.addElement(doc, "home", ri.home);

        return XmlHelper1.DoctoString(doc);
    }
}

